/*
day475 
2020.12.15 
*/
#include<iostream>
#include<vector>
using namespace std;

struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};


class Solution {
public:
    ListNode* deleteNode(ListNode* head, int val) {
		if(head->val==val)
		{
			head=head->next;
			return head;
		}
		
		ListNode *pre=head;
		while(pre->next)
		{
			if(pre->next->val==val)
			{
				pre->next=pre->next->next;
				return head;
			}
            pre=pre->next;
		}
		
		return head;
    }
};


int main()
{
	return 0;
}
